package com.crm.business.agreement.api;


import cn.hutool.core.collection.CollectionUtil;
import com.crm.business.agreement.service.IBillAgreementTemplateService;
import com.crm.business.crm.service.impl.BillOrderApiServiceImpl;
import com.crm.common.constant.Constants;
import com.crm.common.core.redis.RedisCache;
import com.crm.common.crm.entity.BO.BillCrmLoanOrderBO;
import com.crm.common.crm.entity.BO.BillIdenSecretkey;
import com.crm.common.ka.core.common.R;
import com.crm.common.ka.core.common.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

//协议模板
@RestController
@RequestMapping("/api/template")
public class BillTemplateApiController {

    @Autowired
    private IBillAgreementTemplateService billAgreementTemplateService;



    @GetMapping("/openTemplateCallBack")
    @ApiOperation("模板回调")
    public void openTemplateCallBack(@RequestParam("templateIdent")String templateIdent, HttpServletRequest request, HttpServletResponse response) throws IOException {
        String url = billAgreementTemplateService.openTemplateCallBack(templateIdent);
        response.sendRedirect(url);
    }

}
